#8
a = int(input())
b = int(input())
c = int(input())
result = 86400 - a*60*60 - b*60 - c
print(f'{a:02}:{b:02}:{c:02}')
print(f'距离午夜还剩余{result}秒')
